 class Student {
	 private String name;
	 private int age;
	 // 定义构造方法
	 public Student (String name,int age) {
		 name = name;
		 age = age;
	 }
	 public String read () {
		 return "我是："+name+",年龄："+age;
	 }
 }
 public class Example09 {
	 public static void main (String[] args) {
		 Student stu = new Student ("张三"，18) ;
		 System.out.printin (stu.red());
	 }
 }
 // 3-10
 class Student {
	 private String name;
	 private int age;
	 // 定义构造方法
	 public Student (String name,int age) {
		 this.name = name;
		 this.age = age;
	 }
	 public String read () {
		 return "我是："+name+",年龄"+age;
	 }
 }
 public class Example10 {
	 public static void main (String[] args){
	 Student stu = new Student ("张三"，18) ;
	  System.out.printin (stu.red());
	 }
 }
 // 3-11
 class Student {
	 private String name;
	 private int age;
	 public Student () {
		 System.out.printin ("实例化构成了一个新的student对象。");
	 }
	 public Student (String name,int age) {
		 this () ;         // 调用无参的构造方法
		 this.name = name;
		 this.age = age;
	 }
	 public String read () {
		 return "我是："+name+",年龄"+age;
	 }
 }
 public class Example11 {
 	 public static void main (String[] args){
		 Student stu = new Student ("张三"，18) ; //实例化student对象
		  System.out.printin (stu.red());
	}
}
// 3-12
class Student{
	String name;
}
    System.out.println ("我是构造代码块") ；
	}
	// 构造方法
	public Student () {
		 System.out.println ("我是student类的构造方法") ;
	}
	}
	public class Example11 {
	 public static void main (String[] args){
		 Student stu1 = new Student () ;
		  Student stu2 = new Student () ;
		}
	}
	// 3-13
class Student {
	String name;
	int age;
	String school = "A大学"
	public Student (String name ,int age) {
		this.name = name;
		this.age = age;
	}
	public void info () {
		System.out.println("姓名；"+ this. age+",学校：" + school);
	}
}
public class Example13 {
	public static void main (String[] args){
		Student stu1 = new Student ("张三"，18);
		Student stu1 = new Student ("李四"，19);
		Student stu1 = new Student ("王五"，20);
		stu1.info () ;
		stu2.info () ;
		stu3.info () ;
	}
}
package Example15;
class Student{
    private String name;
    private int age;
    private static String school = "A大学";
    public Student (String name,int age) {
        this.name = name;
        this.age = age;
    }
    public void info () {
        System.out.println("姓名:" + this.name+",学校:"+ school);
    }
    public String getName (){
        return  name;
    }
    public void  setName (String name) {
        this.name = name;
    }
    public int getAge () {
        return age;
    }
    public void setAge (int age) {
        this.age = age;
    }
    public static  String getSchool() {
        return school;
    }
    public static  void setSchool (String school) {
        Student.school = school;
    }
}
public class demo15 {
    public static void main(String[] args) {
        Student stu1 = new Student("张三",18);
       Student stu2 = new Student("李四",19);
       Student stu3 = new Student("王五",20);
       stu1.setAge(20);
       stu2.setName("小明");
       Student.setSchool("B大学");
       stu1.info();
       stu2.info();
       stu3.info();
    }
}
package Example14;
class Student {
    String name;
    static String school = "A大学";
    public Student (String name,int age) {
        this.name = name;
        this.age = age;
    }
    public void info() {
        System.out.println("姓名:" +this.name+",年龄:"+this.age",学校:"+ school);
    }
}

public class demo14 {
    public static void main(String[] args) {
        Student stu1 = new Student("张三",18);
        Student stu2 = new Student("李四",19);
        Student stu3 = new Student("王五",20);
        stu1.info();
        stu2.info();
        stu3.info();
    }
}